-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
codegen: allow(unreachable_patterns) #1814
Conversation
…clippy is complaining: ``` error: unreachable pattern --> relay-clients/client-polkadot/src/codegen_runtime.rs:5751:22 | 5751 | Void(runtime_types::sp_core::Void), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ matches no values because `codegen_runtime::api::runtime_types::sp_core::Void` is uninhabited | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types = note: `-D unreachable-patterns` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unreachable_patterns)]` ```
looks like this is a problem just with |
hmm, if not really needed, please just close this |
@@ -81,7 +81,7 @@ impl RuntimeGenerator { | |||
|
|||
Ok(quote! { | |||
#( #item_mod_attrs )* | |||
#[allow(dead_code, unused_imports, non_camel_case_types)] | |||
#[allow(dead_code, unused_imports, non_camel_case_types, unreachable_patterns)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really a clippy lint but a rustc warning.
I don't mind adding this but more interesting why/when the codegen would generate something like an empty enum or something that can't be instantiated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niklasad1 e.g. you can generate it for rococo/westend and run cargo +nighlty clippy
, e.g.:
https://github.com/paritytech/parity-bridges-common/pull/3059/files#diff-611bdbe35fbbfe14f550dc53edae00c57c91bbd07b6fc7ad3cdec38f7f2c6cdb
git clone [email protected]:paritytech/parity-bridges-common.git
cd parity-bridges-common/tools/runtime-codegen
cargo run --bin runtime-codegen -- --from-node-url "wss://rococo-rpc.polkadot.io:443" > ../../relay-clients/client-rococo/src/codegen_runtime.rs
cargo run --bin runtime-codegen -- --from-node-url "wss://westend-rpc.polkadot.io:443" > ../../relay-clients/client-westend/src/codegen_runtime.rs
… support (#3059) * Add `LaneId` generic param * Version * Update testnet runtimes * New polkadot-sdk version * Removed unnecessary `type LaneId` * 1.7.10 -> 1.7.0 * change bullseye? * fix test * I have no idea, inspired by paritytech/frame-metadata#83 * Bump master polkadot-sdk * Fix clippy for new rustc - next regeneration should be fixed when paritytech/subxt#1814 is released * Switch clippy from nightly to stable, because of nalgebra deps hangs 6hours: rust-lang/rust#130056 and also polkadot-sdk is using stable for clippy and doc: https://gitlab.parity.io/parity/mirrors/parity-bridges-common/-/jobs/7515555 https://gitlab.parity.io/parity/mirrors/parity-bridges-common/-/jobs/7515561
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for contributing! 🙏
It looks like with the new rust version (1.81.0) clippy is complaining, e.g.:
https://gitlab.parity.io/parity/mirrors/parity-bridges-common/-/jobs/7505862